﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Web;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using PMS.Common;
using PMS.EntityManage;
using PMS.EntityQuery;
using PMS.BusinessFacade;

namespace BeiXun.Shared.UserControls
{
    public partial class Copyright : System.Web.UI.UserControl
    {
        //private static DateTime updateTime;
        //private static bool isFirst = true;
        //string page = string.Empty;
        //ILog_SYS_AlarmHandler alarmHandler = new Log_SYS_AlarmManage();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
              ////  GetAlarm();
              //  //CheckSystemFuction();
              //  if (isFirst)
              //  {
              //    //  CheckSystemFuction();
              //  }
              //  else
              //  {
              //      ScriptManager.RegisterStartupScript(Page, this.GetType(), "onclick", "getSystemStatus();", true);  
              //  }
            }
        }

        //private void GetAlarm()
        //{
        //    string retStr = string.Empty;// Resources.DataDictionary.NoAlarm;
        //    DataTable dt = alarmHandler.GetLog_SYS_AlarmList("Confirmed=@Confirmed", new System.Data.SqlClient.SqlParameter[] { new System.Data.SqlClient.SqlParameter("@Confirmed", "0") }, " AlarmTime Desc");

        //    if (dt != null && dt.Rows.Count > 0)
        //    {
        //        Random rd = new Random();
        //        int i = rd.Next(0, dt.Rows.Count);
        //        retStr = dt.Rows[i]["Remark"].ToString();
        //        retStr = retStr;
        //    }

        //    result.InnerText = retStr;
        //}
        //private void CheckSystemFuction()
        //{
        //    string retStr = "";
        //    if (isFirst)
        //    {
        //        //第一次获取更新时间

        //        updateTime = Config.GetUpdateTime();
        //        isFirst = false;
        //        retStr = Resources.DataDictionary.StartInFront;
        //    }
        //    else
        //    {
        //        //获取服务器当前时间
        //        DateTime sysDate = Config.GetUpdateTime();
        //        if (sysDate != updateTime)
        //        {
        //            retStr = Resources.DataDictionary.BackgroundStatusOK;
        //            //  return true;
        //        }
        //        else
        //        {
        //            retStr = Resources.DataDictionary.BackgroundStatusERROR;
        //        }
        //    }
        //    CheckSystem.InnerText = retStr;
        //}
    }
}